import axios from '@/api/config'
import {baseURL} from "@/api/ipconfig"
var ip = baseURL.URL1

//系统管理接口  

//短信设置相关接口  开始=======

// //获取消息模板列表
// export const getList = () => axios.post('/msg/template/list') //接口不对


// //添加消息模板
// export const addMessageTemplate = (data) => axios.post('/msg/template/config', data) //接口不对

// //通过主键获取信息
// export async function messageDetail(data) {
//   const url = '/msg/template/' + data;
//   let res = await axios.get(url);
//   return res;
// }

// // /msg/template/disable/{id}/{state}

//短信设置相关接口  =======结束

//其他设置相关接口   开始=========

//获取产品列表
export const productList = data => axios.post(ip+'/system/page', data);

//通过主键获取信息
export async function detail(data) {
  const url = ip+'/system/one/' + data;
  let res = await axios.get(url);
  return res;
}

//新增
export const add = data => axios.post(ip+'/system', data)

//修改
export const update = data => axios.put(ip+'/system', data)

//删除和批量删除
export async function remove(data) {
  const url = ip+'/system/logic';
  let res = await axios.delete(url, {
    data
  });
  return res;
}
//获取默认密码
export async function getDefaultPassword() {
  const url = ip+'/superAdmin/defaultPassword';
  let res = await axios.get(url);
  return res;
}
//修改默认密码接口
export async function updatePassword(data) {
  const url = ip+'/superAdmin/defaultPassword/' + data.password;
  let res = await axios.put(url);
  return res;
}
//其他设置相关接口   =========结束
